home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / mawk.zip / MEMORY.H < prev    next >
C/C++ Source or Header  |  1991-04-07  |  1KB  |  51 lines

  1.  
  2. /********************************************
  3. memory.h
  4. copyright 1991, Michael D. Brennan
  5.  
  6. This is a source file for mawk, an implementation of
  7. the Awk programming language as defined in
  8. Aho, Kernighan and Weinberger, The AWK Programming Language,
  9. Addison-Wesley, 1988.
  10.  
  11. See the accompaning file, LIMITATIONS, for restrictions
  12. regarding modification and redistribution of this
  13. program in source or binary form.
  14. ********************************************/
  15.  
  16.  
  17. /* $Log:    memory.h,v $
  18.  * Revision 2.1  91/04/08  08:23:37  brennan
  19.  * VERSION 0.97
  20.  * 
  21. */
  22.  
  23.  
  24. /*  memory.h  */
  25.  
  26. #ifndef  MEMORY_H
  27. #define  MEMORY_H
  28.  
  29. #include "zmalloc.h"
  30.  
  31. #define  new_CELL()  (CELL *) zmalloc(sizeof(CELL))
  32. #define  free_CELL(p)  zfree(p,sizeof(CELL))
  33.  
  34. #ifndef  SUPPRESS_NEW_STRING_PROTO
  35. STRING  *PROTO( new_STRING, (char *, ...) ) ;
  36. #endif
  37.  
  38. #ifdef   DEBUG
  39. void  PROTO( DB_free_STRING , (STRING *) ) ;
  40.  
  41. #define  free_STRING(s)  DB_free_STRING(s)
  42.  
  43. #else
  44.  
  45. #define  free_STRING(sval)   if ( -- (sval)->ref_cnt == 0 )\
  46.                                 zfree(sval, (sval)->len+5) ; else
  47. #endif
  48.  
  49.  
  50. #endif   /* MEMORY_H */
  51.